package com.skycode5.servlet;

import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/newsDetail.html")
public class NewsDetailServlet extends HttpServlet {
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws SecurityException, IOException {
        String id = req.getParameter("newsID");
        int id = Integer.parseInt(newsID)
                req.setAttribute("title",newsBean.getNewsByID(id));
        req.setAttribute("content",newsBean.getNewsContent());
        req.setAttribute("news");
    }
}
